# 获取教程、习题、案例，共同学习、讨论、打卡
# 请关注：Crossin的编程教室
# 学习交流群：【微信】sunset24678（添加时备注：python）【QQ】群号见 https://python666.cn/c/9

# 遍历字典
phones_dict = {
    '小白': 13313313133,
    '小黑子': 18988988899, 
    '🐔哥': 13913913139,
    '老师': 13001313013
}
for k in phones_dict:
    print(k)

# 遍历字典的值
for k in phones_dict:
    print(phones_dict[k])

for v in phones_dict.values():
    print(v)

print(phones_dict.keys())

# 遍历字典的键值对
for k, v in phones_dict.items():
    print(k, v)

print(phones_dict.items())

# 元组
item = ('小白', 13313313133)
print(item[0])
print(item[1])

# 字典的值
jict = {
    'likes': ('🎤', '💃', '🏀'),
    'phones': [13813813138, 13913913139],
    'info': {
        'name': '🐔哥',
        'years': 2.5
    }
}
print(jict)

jict['xx'] = jict
print(jict)

print(id(jict), id(jict['xx']))

# 字典的键
my_dict = {
    'num': 123,
    456: None,
    True: False,
    (1, 2): 0
#     [1, 2]: 0
#     {1: 2}: 0

}
print(my_dict)

# 值查键
phones_dict = {
    '小白': 13313313133,
    '小黑子': 18988988899, 
    '🐔哥': 13913913139,
    '老师': 13001313013
}
phone = input()
for k in phones_dict:
    if str(phones_dict[k]) == phone:
        print(k)

